<?php
//Social Media Icons based on the profile user info
function member_social_extend(){
		$dmember_id = $bp->displayed_user->id;
		$fb_info = xprofile_get_field_data('Testfeld', $dmember_id);
		$google_info = xprofile_get_field_data('googleplus', $dmember_id);
		$twitch_info = xprofile_get_field_data('twitch', $dmember_id);
		$twitter_info = xprofile_get_field_data('twitter', $dmember_id);
		echo '<div class="member-social">';
		if($fb_info||$google_info||$twitch_info||$twitter_info){
			echo 'My Social: ';
		}

		if ($fb_info) {
		?>
		<span class="fb-info"><a href="https://www.facebook.com/<?php echo $fb_info; ?>"  title="My Facebook" target="_blank"><img src="<?php bloginfo('wpurl'); ?>/wp-content/themes/your_theme_name_here/images/facebook.png" /></a></span>
	<?php
	}
		?>
		<?php
		if ($google_info) {
		?>
		<span class="google-info"><a href="https://profiles.google.com/<?php echo $google_info; ?>" title="My Googleplus" target="_blank"><img src="<?php bloginfo('wpurl'); ?>/wp-content/themes/your_theme_name_here/images/google-plus.png" /></a></span>
	<?php
	}
		?>
		<?php
		if ($twitch_info) {
		?>
		<span class="twitch-info"><a href="http://www.twitch.tv/<?php echo $twitch_info; ?>" title="My Twitch" target="_blank"><img src="<?php bloginfo('wpurl'); ?>/wp-content/themes/your_theme_name_here/images/twitch.png" /></a></span>
	<?php
	}
		?>
		<?php
		if ($twitter_info) {
		?>
		<span class="twitter-info"><a href="https://twitter.com/<?php echo $twitter_info; ?>" title="My Twitter" target="_blank" class="twitter-follow-button""><img src="<?php bloginfo('wpurl'); ?>/wp-content/themes/your_theme_name_here/images/twitter.png" /></a></span>
	<?php
	}
	echo '</div>';
}
add_filter( 'bp_before_member_header_meta', 'member_social_extend' ); ?>